﻿@*@model IEnumerable<Max.DTO.UserDTO>*@



@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_Layout.cshtml";
   
}




<h2>Index</h2>

@{
    
    var grid = new WebGrid(source: Model, defaultSort: "user_id", rowsPerPage: 3);
    
}


<div>
    @grid.GetHtml(
    columns: grid.Columns(
    //grid.Column("Name", format: @<i>@item.user_name</i>),
    
    grid.Column("user_name","Name"),
    grid.Column("user_email","Email"),
    grid.Column("user_password","Email"),
    //grid.Column(format: (item) => Ajax.ActionLink("Edit", "Details", new { id = item.user_id }))    
    grid.Column(format: (item) => Html.ActionLink("Edit", "UpdateUserInfo", new { id = item.user_id }, new {href="javascript:void(0)", @class = "EditImageButton",onclick="return confirm('Are you sure?');"}))
    //@Html.ActionLink(" ", "", "", new {href="javascript:void(0)"})
    
    )
    )

</div>

@*@foreach (var item in Model)
{
    <tr>
        <td>
            @item.user_id
        </td>
        <td>
            @item.user_email
        </td>
    </tr>

    <br />
}*@


<p>

    @using (Html.BeginForm("Add", "User", FormMethod.Post))
    { 
        @Html.TextBox("user_email_form")
        <br />
        @Html.TextBox("user_name_form")
        <br />
        @Html.TextBox("user_password_form")
        <br />
    
        <input type="submit" value="Save" title="Submit Button" name="navigate" />
    
    }


    @using (Html.BeginForm("Add", "User", FormMethod.Post))
    { 
    
        <input type="submit" value="Update" title="Submit Button" name="navigate" />
    
    }

    @* @Html.DisplayNameFor(model => model.user_name)
     @Html.DisplayNameFor(model => model.user_password)
     @Html.DisplayNameFor(model => model.user_email)
     @Html.DisplayNameFor(model => model.user_modify_date)*@


</p>
